using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SailHero.Soft.FrameWork.Models;

namespace SailHero.Soft.FrameWork.Mapping.HJT212DB
{
    public class PointBaseInfoMap : EntityTypeConfiguration<PointBaseInfo>
    {
        public PointBaseInfoMap()
        {
            // Primary Key
            this.HasKey(t => t.P_ID);

            // Properties
            this.Property(t => t.Diminutive)
                .HasMaxLength(20);

            this.Property(t => t.PointName)
                .HasMaxLength(50);

            this.Property(t => t.PointType)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.GisParams)
                .IsRequired()
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("PointBaseInfo");
            this.Property(t => t.P_ID).HasColumnName("P_ID");
            this.Property(t => t.Diminutive).HasColumnName("Diminutive");
            this.Property(t => t.PointName).HasColumnName("PointName");
            this.Property(t => t.IsAuto).HasColumnName("IsAuto");
            this.Property(t => t.Paren_ID).HasColumnName("Paren_ID");
            this.Property(t => t.PointType).HasColumnName("PointType");
            this.Property(t => t.IsObject).HasColumnName("IsObject");
            this.Property(t => t.GisParams).HasColumnName("GisParams");
        }
    }
}
